home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpC_106_ModalDialog < prev    next >
Encoding:
Text File  |  1992-04-08  |  2.2 KB  |  107 lines

  1. /* %filename% -- Modal dialog */
  2. /* Created %date% %time% by AppMaker */
  3.  
  4. #include <Types.h>
  5. #include <Quickdraw.h>
  6. #include <Controls.h>
  7. #include <Dialogs.h>
  8. #include <Events.h>
  9. #include <Lists.h>
  10. #include <Menus.h>
  11. #include <TextEdit.h>
  12. #include "ResourceDefs.h"
  13. #include "Miscellany.h"
  14. #include "DialogAids.h"
  15. #include "WindowAids.h"
  16. #include "%dlogname%.h"
  17.  
  18. %for each item gen itemNr%
  19.  
  20. %If lang = MPW%
  21.     #pragma segment %dlogname% 
  22.  
  23. %end if%
  24. %for each item gen auxiliaryProto%
  25. %if needsFilter%
  26.     static pascal Boolean Filter%dlogname%%    %(DialogPtr        whichDialog,
  27.                                              EventRecord    *event,
  28.                                              short            *itemHit);
  29. %endif%
  30.  
  31. %push needsRefCon%
  32. %for each item gen auxiliary%
  33. %if needsFilter%
  34.     /*----------*/
  35.     static pascal Boolean Filter%dlogname%%    %(DialogPtr        whichDialog,
  36.                                              EventRecord    *event,
  37.                                              short            *itemHit)
  38.     {
  39.         Boolean                filtered;
  40.         %dlogname%RecPtr%    %data;
  41.  
  42.     #pragma unused (data) 
  43.     
  44.         filtered = false;
  45.         %for each item gen filter%
  46.  
  47.         if (!filtered) {
  48.             filtered = StandardFilter (whichDialog, event, itemHit);
  49.         }
  50.         return (filtered);
  51.     } /*Filter%dlogname%*/
  52.     
  53. %endif%
  54. /*----------*/
  55. Boolean Get%dlogname% (%dlogname%Rec%    %*%dlogname%)
  56. {
  57.     DialogPtr        theDialog;
  58.     GrafPtr            savePort;
  59.     Boolean            result;
  60.     Boolean            done;
  61.     short            itemNr;
  62.     register %dlogname%RecPtr    info;
  63.  
  64.     GetPort (&savePort);
  65.     InitCursor ();
  66.     theDialog = GetNewDialog (%dlogname%ID, nil, (WindowPtr) -1L);
  67.     %if needsRefCon%
  68.         SetWRefCon (theDialog, (long) %dlogname%);
  69.     %endif%
  70.     SetPort (theDialog);
  71.     info = %dlogname%;
  72.     %for each item gen set%
  73.     
  74.     ShowWindow (theDialog);
  75.     OutlineButton (1);
  76.     done = false;
  77.     while (!done) {
  78.         %for each item gen enable%
  79.  
  80.         %if procID = 5%
  81.             %if needsFilter%
  82.                 MovableDialog ((ModalFilterProcPtr)Filter%dlogname%, &itemNr);
  83.             %else%
  84.                 MovableDialog ((ModalFilterProcPtr)StandardFilter, &itemNr);
  85.             %end if%
  86.         %else%
  87.             %if needsFilter%
  88.                 ModalDialog (Filter%dlogname%, &itemNr);
  89.             %else%
  90.                 ModalDialog (StandardFilter, &itemNr);
  91.             %end if%
  92.         %end if%
  93.         switch (itemNr) {
  94.             %for each item gen hit%
  95.  
  96.         } /* switch */
  97.     } /* while */
  98.     %for each item gen finish%
  99.  
  100.     DisposDialog (theDialog);
  101.     SetPort (savePort);
  102.     return (result);
  103. } /*Get%dlogname%*/
  104.  
  105. /* %dlogname% */
  106. %pop needsRefCon%
  107.